<?php
		include 'head.php';
		$sql = "select type,url,path,orders,remark from en_trunimg where type =1 order by orders ";
		$result = mysql_query($sql);//大幻灯片广告
		
		
?><head>
	 
	 <link rel="stylesheet" href="css/all.css" type="text/css" media="screen" />
	<link rel="stylesheet" type="text/css" href="js/jcarousel_css/skin.css" />	
	
	<style>

	#slider a{
	        display:block;
			
	}
	
	#bigtrunbtn
	{	
		display: inline;
		width:159px;
		hegiht:18px;
		float:left;
		margin:-50px 0px 0px 765px;
		position:absolute;
		z-index:1;
		
	}
	#bigtrunbtn a
	{
		color:#36f;
		font:700 11px "Arial";
		background:url(images/47.png) no-repeat scroll 1px 0px;
		float:left;
		width:25px;
		height:24px;
		line-height:24px;
		text-align:center;
		text-decoration:none;
		margin-left:5px;
	}
	
	#bigtrunbtn a.activeSlide
	{	
		color:#fff;
		background:url(images/48.png) no-repeat scroll -1px 0;
	}
	#bigtrunbtn a:hover
	{	
		color:#fff;
		background:url(images/48.png) no-repeat;
	}
	#news_btn{
	
		width:100px;
		margin: 0 auto;
	}
	#news_btn a{
		color:black;
		background-image:url('images/26.png');
		width:20px;
		height:20px;
		line-height:19px;
		text-align:center;
		text-decoration:none;
		float:left;
		
	}
	#news_btn a.activeSlide
	{
		background-image:url('images/27.png');
	}
	#news_btn a.hover
	{
		background-image:url('images/27.png');
	}
	
	.news_a{
	
		text-decoration:none;
		color:black;
	}
	.news_a:hover{
	
		text-decoration:underline;
		color:red;
	}
</style>
	<script type="text/javascript" src="js/jquery.cycle.all.js"></script>
	
	<script src="js/jquery.jcarousel.min.js"></script>
	
	<script >
	
	$(document).ready(function(){
		
		$('#banner').cycle({ 
			fx:'scrollLeft',
			timeout: 8000,
			pager:'#bigtrunbtn'
			
		});
		$('#bottomImgItem').jcarousel({
			step:3
		});

		$("#turn_news").cycle({
			
			fx:'scrollLeft',
			timeout: 8000,
			pager:'#news_btn'	
		});
		
	});

	
	
	  
	  function TurnSmallImg(v,obj)
	  {
		  $(".tsmallimg").hide();
		  $("#smallimg"+v).show();
		  $(".tsmallbtn").css('background-image','url(images/26.png)');
		    $(obj).css('background-image','url(images/27.png)');
	  }
	  function TurnList(s,h,obj,btn)
	  {
		  $("#"+s).show();
		  $("#"+h).hide();
		  
		  $(obj).css('background-image','url(images/30.png)');
		  $('#'+btn).css('background-image','');
	  }
	  function TrunNews(obj)
	  {
		  $(obj).children().hide();
		  var hidTd= $(obj).parent().find('.hidtd');
		  
		  hidTd.show();
	  }

	  function TrunNewsLeave(obj)
	  {
		  $(obj).children().show();
		  var hidTd= $(obj).parent().find('.hidtd');
		  
		  hidTd.hide();
	  }
	
	
   </script>
   
	</head> 
	
	


	<div id="mxh" style="width:960px;margin:0 auto;">
		
		<!-- 大幻灯片广告 -->
		<div id="banner" style="height:365px;z-index:1; width:960px;">
		    <?php
		        while($row = mysql_fetch_array($result))
		        {
		        	echo '<a href="'.$row['url'].'"  target="_blank" ><img  src="'.$row['path'].'" /></a>';
		        }  
		    ?>
		</div>
		<div id="bigtrunbtn" ></div>
		
		

		<div style="clear:both;"></div>
		<div style="background-color:white;height:600px;width:960px;margin-top:5px;">
			<div style="height:33px;"></div>
			<!-- 公告 -->
			<div style="text-align:center;margin-left:16px;background-image:url('images/14.png');width:108px;height:31px;line-height:31px; font-weight:bold;float:left;display:inline;font-size:12px;font-family:宋体;color:#9fca23">Announcement</div>
			<?php 
			  		$sql = "select id,title from en_problem where flag=1 order by dates desc";
			  		$result = mysql_query($sql);
			  		//$row = mysql_fetch_array($result);
			?>
			<div style="margin-left:2px;  float:left;background-image:url('images/15.png');width:534px;height:31px;line-height:31px; display:inline;" >
				<marquee style="padding:0;margin:0;" hspace="10" vspace="6" style="width:580px;"  scrollamount="2" direction="left" ><?php while($row = mysql_fetch_array($result)){?><a href="service_info.php?id=<?php echo $row['id'];?>" target="_blank" style="color:black; text-decoration:none;"><?php echo $row['title']?></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php }?></marquee>
			</div>
			<!-- 微博关注 -->
			<div style="float:left; background-image:url('images/16.png');margin-left:5px;width:188px;height:31px;line-height:31px;display:inline;">
					   <div style="float:left;margin-left:14px;">Follow us:</div>
					   <?php 
			  		      $sql = "select * from en_basicinfo";
			  		      $result = mysql_query($sql);
			  		      $row = mysql_fetch_array($result);
			           ?>
					   <div style="float:left;margin-left:12px;"><img src="images/17.png" /></div>
					   <div style="float:left;margin-left:13px;margin-top:7px;cursor:pointer;"><a href="<?php echo $row['sina_url'];?>" target="_blank"><img src="images/18.png" /></a></div> 
					   <div style="float:left;margin-left:13px;margin-top:7px;cursor:pointer;"><a href="<?php echo $row['qq_url'];?>" target="_blank"><img src="images/19.png" /></a></div> 
					   <div style="float:left;margin-left:13px;margin-top:7px;cursor:pointer;"><a href="<?php echo $row['rss_url'];?>" target="_blank"><img src="images/20.png" /></a></div> 
					   
			</div>
			<a href="<?php echo $row['ebay_link']?>" style="margin-left:5px;"><img src="images/ebaybt1.png" /></a>
			<div style="clear:both;"></div>
			<div style="float:left">
			<!-- 动态新闻 -->
				<div style="width:308px;margin-top:10px;margin-left:17px;">
				   <div style="width:308px;height:26px; background-image:url('images/22.png');line-height:26px;font-weight:bold;text-align:left;color:#ffffff;"><font style="margin-left:15px">Hot Sale</font></div>
					   <div id="turn_news" style="width:308px;height:279px;">
					   <?php
					   $sql = "select type,url,path,orders,remark from en_trunimg where type =2 order by orders ";
		               $result = mysql_query($sql);//大幻灯片广告 
		               while($row = mysql_fetch_array($result)){
					   ?>
					   <a href="<?php echo $row['url']?>"> <img src="<?php echo $row['path'];?>" /></a>
					   <?php }?>
					   </div>
				  <div style="width:308px;height:24px;background-image:url('images/23.png');">
				  
				  	<!-- 动态新闻切换按钮 -->
				    <div id="news_btn">
				       
				    </div>
				  </div>  
				</div>
				<!-- 热销产品&最新产品 -->
				<div style="background-image:url('images/28.png');width:309px;height:162px;float:left;margin-top:5px;margin-left:17px;display:inline;">
					<div style="background-image:url('images/29.png');width:309px;height:33px;background-repeat:no-repeat;">
					    <div id='hotbtn' onclick="TurnList('hotlist','newlist',this,'newbtn')" style="cursor:pointer;margin-top:4px;margin-left:4px; background-image:url('images/30.png');float:left;width:137px;height:31px;line-height:31px;text-align:center;display:inline;">Hot Sale</div>
					    <div id='newbtn' onclick="TurnList('newlist','hotlist',this,'hotbtn')" style="cursor:pointer;margin-top:4px;margin-left:27px;float:left;height:31px;line-height:31px;text-align:center;width:137px;display:inline;">New arrival</div>
					</div>
					<!-- 热销 -->
					<?php 
					     $sql = "select a.id,a.name,a.price,a.dates from en_product as a inner join en_pro_type as b on a.type_id = b.id where a.ishot=1 and a.flag =1 order by a.id desc limit 0,4";
					     $result = mysql_query($sql);
					?>
					<div id="hotlist" >
					   <ul style="height:88px;list-style:none;margin:0;margin-top:3px; margin-left:10px;padding:0px;">
					   <?php

					      while($row = mysql_fetch_array($result))
					      {
					    ?>
					      	<li style="background-image:url(\'images/31.png\');width:293px;height:20px;line-height:22px;text-align:left;margin-top:1px;">
					      	 	<div style="overflow:hidden;width:200px;float:left;margin-left:10px;display:inline;text-overflow:ellipsis">
					      	 		<a style="color:#336699;font-size:12px;text-decoration:none;"  href="product_info.php?id=<?php echo $row['id'];?>"><nobr><?php echo $row['name']."(".$row['dates'].")"?></nobr></a>
					      	 	</div>
					      	 <div style="width:65px;text-align:right;float:left;margin-right:14px;display:inline;">(￥<?php echo $row['price'];?>)</div>
					      </li>
					  <?php    
					      }
					   ?>
					   </ul>
					   <p style="text-align: right;"><img style="margin-right:5px;margin-top:-2px; vertical-align: middle;" src="images/32.png" /><a style="margin-right:14px;color:#336699;font-size:12px;text-decoration:none;" href="product.php">More</a></p>
					</div>
					<!-- 最新 -->
					<?php 
					     $sql = "select a.id,a.name,a.price,a.dates from en_product as a inner join en_pro_type as b on a.type_id = b.id where a.isnews=1 and a.flag =1 order by a.id desc limit 0,4";
					     $result = mysql_query($sql);
					?>
					<div id="newlist" style="display:none;">
						 <ul style="height:88px;list-style:none;margin:0;margin-top:3px; margin-left:10px;padding:0px;">
						 <?php 
						  while($row = mysql_fetch_array($result))
					      {
					      	 echo ' <li style="background-image:url(\'images/31.png\');width:293px;height:20px;line-height:22px;text-align:left;margin-top:1px;"><div style="overflow:hidden;width:200px;float:left;margin-left:10px;display:inline;text-overflow:ellipsis"><a style="color:#336699;font-size:12px;text-decoration:none;"  href="'."product_info.php?id={$row['id']}".'"><nobr>'.$row['name'].'('.$row['dates'].')</nobr></a></div><div style="width:65px;text-align:right;float:left;margin-right:14px;display:inline;">(￥'.$row['price'].')</div></li>';
					      }
						 ?>
					   </ul>
					   <p style="text-align: right;"><img style="margin-right:5px;margin-top:-2px; vertical-align: middle;" src="images/32.png" /><a style="margin-right:14px;color:#336699;font-size:12px;text-decoration:none;" href="product.php">More</a></p>
					</div>
				</div>
			</div>
			<!-- 新闻资讯 -->
			<div style="background:url('images/33.png');width:602px;height:493px;float:left;display:inline;margin-top:10px;margin-left:17px;">
				<div style="background-image:url('images/34.png');width:602px;height:25px;line-height:25px;">  
					<div style="float:left;margin-left:11px;">News</div> 
					<div style="float:right;margin-right:8px;"></div>
				</div>
				 <!-- 置顶新闻 -->
				 <?php 
				    $sql = "select id,title,content,dates,path,remark from en_news where istop = 1 and flag =1 order by dates desc ";
				    $result = mysql_query($sql);
				    $row = mysql_fetch_array($result);
				    $remark = $row['remark'];
				    if(strlen($row['remark'])>125)
				    {
				    	$remark = mb_substr($row['remark'],0,125,'utf-8') ;
				    }
				    
				 ?>
				 <div style="background-image:url('images/35.png');width:600px;height:140px;margin-left:1px;">
				   <div style="float:left;width:413px;margin-top:20px;">
				       <div style=""><a  href="news_info.php?id=<?php echo $row['id']?>" style="color:#336699;font-size:14px;text-decoration:none;font-weight:bold;margin-left:10px;" ><?php echo $row['title'];?></a></div>
				   		<div   style="height:54px;margin-left:10px;margin-right:10px;margin-top:10px;font-size:13px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="news_a" href="news_info.php?id=<?php echo $row['id'];?>"><?php echo $remark;?></a>......</div>
				   		<div style="text-align:left;margin-left:10px;margin-top:10px;"><?php echo $row['dates'];?> <a style="margin-left:290px;color:#336699; font-size: 12px; " href="news_info.php?id=<?php echo $row['id']?>">Detail</a></div>
				   </div>
				   <div style="float:left;margin-top:10px;">
				      <a  href="news_info.php?id=<?php echo $row['id'];?>"><img style="width:165px;height:110px;" src="<?php  echo $row['path'];?>" /></a>
				   </div>
				</div>
				<!-- 普通新闻10条 -->
				<?php 
				
				 $zhiding_id = $row['id'];
				 $sql = "select id,title,content,dates,path from en_news where flag =1 and id != ".$zhiding_id." order by dates desc limit 0,10 ";
				 $result = mysql_query($sql);
				 
				?>
				<div style="height:280px;">
				    <ul style="list-style:none;margin:0; padding: 0;">
				    	<?php 
				    	   while($row = mysql_fetch_array($result))
				    	   {
				    	 ?>
				    	   	 <li style="margin-left:10px; margin-top:15px;background:url(\'images/39.png\') left center no-repeat; text-indent:10px;height:12px;line-height:12px;vertical-align:bottom">
				    	   	 	<span style="float:left"><a class="news_a" href="news_info.php?id=<?php echo $row['id'];?>"><?php echo $row['title'];?></a></span>
				    	   	 	<span style="float:right;margin-right:20px;"><?php echo $row['dates'];?></span>
				    	   	 </li>
				    	<?php   
				    	   }
				    	?>
				      
				    </ul>
				</div>
				<p style="text-align: right; padding-right:15px;"><img style="margin-right:5px;margin-top:-2px; vertical-align: middle;" src="images/32.png" /><a style="text-decoration:none;color:#336699" href="news.php">More</a></p>
			</div>
		</div>
		
		
		<!--产品广告滚动  -->
			<?php 
			$sql = "select a.id,a.name,a.model,a.type_id,a.price,a.path,a.remark,a.content,a.dates,a.ishot,a.isnews,b.name as type_name from en_product as a
			inner join pro_type as b on a.type_id=b.id
			where a.flag =1";
			$result = mysql_query($sql);
			?>
			  		  	 <ul id="bottomImgItem" class="jcarousel-skin-tango" style="width:960px;overflow:hidden;">
			  		  	 <?php 
			  		  	 		while($row = mysql_fetch_array($result))
			  		  	 		{
			  		  	 		    if(cnStrLen($row['name']) > 26)
			  		  	 			{
			  		  	 				$row['name'] = cnSubStr($row['name'],0,26)."...";
			  		  	 			}
			  		  	 ?>
			  		  	 
			  		  	 	<li><a href="product_info.php?id=<?php echo $row["id"]?>"><img style="width:204px;height:147px;" src="<?php echo $row["path"]?>"/></a><a href="product_info.php?id=<?php echo $row["id"]?>" style="text-decoration:none;"><?php echo $row["name"]?></a></li>
			  		  	 <?php
			  		  	 		}
			  		  	 ?>
			  		  	    
			  		  	    
			  		  	 </ul>
			  		
			
			<?php include 'bottom.php';?>
	</div>
 